package com.yejiali.backend.controller;

import com.yejiali.backend.response.Response;
import com.yejiali.backend.service.FileUploadService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author:yejiali
 * @Date:2025/5/20-05-20-8:36
 * @Decsription:com.yejiali.backend.controller
 * @Version:1.0
 */
@RestController
@RequestMapping("/file")
@Tag(name = "用户管理", description = "用户相关操作接口")
public class FileUploadController {
    @Autowired
    private FileUploadService fileUploadService;

    @PostMapping("/upload")
    @Operation(summary = "用户头像上传", description = "用户头像上传到oss中")
    public Response saveImage(@RequestParam("image") MultipartFile file){
        return fileUploadService.saveImage(file);
    }


}
